using Xunit;
using MyLibrary;

namespace MyLibrary.Tests
{
    public class PrimeFactorizerTests
    {
        [Fact]
        public void PrimeFactors_ReturnsCorrectFactors_ForNumber4()
        {
            // Arrange
            var factorizer = new PrimeFactorizer();

            // Act
            var result = factorizer.PrimeFactors(4);

            // Assert
            Assert.Equal("2×2", result);
        }

        [Fact]
        public void PrimeFactors_ReturnsCorrectFactors_ForNumber30()
        {
            // Arrange
            var factorizer = new PrimeFactorizer();

            // Act
            var result = factorizer.PrimeFactors(30);

            // Assert
            Assert.Equal("2×3×5", result);
        }

        [Fact]
        public void PrimeFactors_ThrowsArgumentOutOfRangeException_ForNumberLessThan2()
        {
            // Arrange
            var factorizer = new PrimeFactorizer();

            // Act & Assert
            Assert.Throws<ArgumentOutOfRangeException>(() => factorizer.PrimeFactors(1));
        }

        [Fact]
        public void PrimeFactors_ThrowsArgumentOutOfRangeException_ForNumberGreaterThan1000()
        {
            // Arrange
            var factorizer = new PrimeFactorizer();

            // Act & Assert
            Assert.Throws<ArgumentOutOfRangeException>(() => factorizer.PrimeFactors(1001));
        }

        [Fact]
        public void PrimeFactors_ReturnsCorrectFactors_ForPrimeNumber()
        {
            // Arrange
            var factorizer = new PrimeFactorizer();

            // Act
            var result = factorizer.PrimeFactors(13);

            // Assert
            Assert.Equal("13", result);
        }

        [Fact]
        public void PrimeFactors_ReturnsCorrectFactors_ForCompositeNumber()
        {
            // Arrange
            var factorizer = new PrimeFactorizer();

            // Act
            var result = factorizer.PrimeFactors(60);

            // Assert
            Assert.Equal("2×2×3×5", result);
        }
    }
}